/*
 * XML Type:  PayeeModResponse
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.PayeeModResponse
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML PayeeModResponse(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class PayeeModResponseImpl extends net.ofx.types.x2003.x04.impl.AbstractPayeeResponseImpl implements net.ofx.types.x2003.x04.PayeeModResponse
{
    
    public PayeeModResponseImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName PAYEE$0 = 
        new javax.xml.namespace.QName("", "PAYEE");
    private static final javax.xml.namespace.QName BANKACCTTO$2 = 
        new javax.xml.namespace.QName("", "BANKACCTTO");
    private static final javax.xml.namespace.QName PAYACCT$4 = 
        new javax.xml.namespace.QName("", "PAYACCT");
    private static final javax.xml.namespace.QName EXTDPAYEE$6 = 
        new javax.xml.namespace.QName("", "EXTDPAYEE");
    
    
    /**
     * Gets the "PAYEE" element
     */
    public net.ofx.types.x2003.x04.Payee getPAYEE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Payee target = null;
            target = (net.ofx.types.x2003.x04.Payee)get_store().find_element_user(PAYEE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "PAYEE" element
     */
    public boolean isSetPAYEE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PAYEE$0) != 0;
        }
    }
    
    /**
     * Sets the "PAYEE" element
     */
    public void setPAYEE(net.ofx.types.x2003.x04.Payee payee)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Payee target = null;
            target = (net.ofx.types.x2003.x04.Payee)get_store().find_element_user(PAYEE$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Payee)get_store().add_element_user(PAYEE$0);
            }
            target.set(payee);
        }
    }
    
    /**
     * Appends and returns a new empty "PAYEE" element
     */
    public net.ofx.types.x2003.x04.Payee addNewPAYEE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Payee target = null;
            target = (net.ofx.types.x2003.x04.Payee)get_store().add_element_user(PAYEE$0);
            return target;
        }
    }
    
    /**
     * Unsets the "PAYEE" element
     */
    public void unsetPAYEE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PAYEE$0, 0);
        }
    }
    
    /**
     * Gets the "BANKACCTTO" element
     */
    public net.ofx.types.x2003.x04.BankAccount getBANKACCTTO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().find_element_user(BANKACCTTO$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "BANKACCTTO" element
     */
    public boolean isSetBANKACCTTO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(BANKACCTTO$2) != 0;
        }
    }
    
    /**
     * Sets the "BANKACCTTO" element
     */
    public void setBANKACCTTO(net.ofx.types.x2003.x04.BankAccount bankacctto)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().find_element_user(BANKACCTTO$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.BankAccount)get_store().add_element_user(BANKACCTTO$2);
            }
            target.set(bankacctto);
        }
    }
    
    /**
     * Appends and returns a new empty "BANKACCTTO" element
     */
    public net.ofx.types.x2003.x04.BankAccount addNewBANKACCTTO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BankAccount target = null;
            target = (net.ofx.types.x2003.x04.BankAccount)get_store().add_element_user(BANKACCTTO$2);
            return target;
        }
    }
    
    /**
     * Unsets the "BANKACCTTO" element
     */
    public void unsetBANKACCTTO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(BANKACCTTO$2, 0);
        }
    }
    
    /**
     * Gets array of all "PAYACCT" elements
     */
    public java.lang.String[] getPAYACCTArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PAYACCT$4, targetList);
            java.lang.String[] result = new java.lang.String[targetList.size()];
            for (int i = 0, len = targetList.size() ; i < len ; i++)
                result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getStringValue();
            return result;
        }
    }
    
    /**
     * Gets ith "PAYACCT" element
     */
    public java.lang.String getPAYACCTArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(PAYACCT$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) array of all "PAYACCT" elements
     */
    public net.ofx.types.x2003.x04.IdType[] xgetPAYACCTArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PAYACCT$4, targetList);
            net.ofx.types.x2003.x04.IdType[] result = new net.ofx.types.x2003.x04.IdType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets (as xml) ith "PAYACCT" element
     */
    public net.ofx.types.x2003.x04.IdType xgetPAYACCTArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.IdType target = null;
            target = (net.ofx.types.x2003.x04.IdType)get_store().find_element_user(PAYACCT$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return (net.ofx.types.x2003.x04.IdType)target;
        }
    }
    
    /**
     * Returns number of "PAYACCT" element
     */
    public int sizeOfPAYACCTArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PAYACCT$4);
        }
    }
    
    /**
     * Sets array of all "PAYACCT" element
     */
    public void setPAYACCTArray(java.lang.String[] payacctArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(payacctArray, PAYACCT$4);
        }
    }
    
    /**
     * Sets ith "PAYACCT" element
     */
    public void setPAYACCTArray(int i, java.lang.String payacct)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(PAYACCT$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.setStringValue(payacct);
        }
    }
    
    /**
     * Sets (as xml) array of all "PAYACCT" element
     */
    public void xsetPAYACCTArray(net.ofx.types.x2003.x04.IdType[]payacctArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(payacctArray, PAYACCT$4);
        }
    }
    
    /**
     * Sets (as xml) ith "PAYACCT" element
     */
    public void xsetPAYACCTArray(int i, net.ofx.types.x2003.x04.IdType payacct)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.IdType target = null;
            target = (net.ofx.types.x2003.x04.IdType)get_store().find_element_user(PAYACCT$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(payacct);
        }
    }
    
    /**
     * Inserts the value as the ith "PAYACCT" element
     */
    public void insertPAYACCT(int i, java.lang.String payacct)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = 
                (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(PAYACCT$4, i);
            target.setStringValue(payacct);
        }
    }
    
    /**
     * Appends the value as the last "PAYACCT" element
     */
    public void addPAYACCT(java.lang.String payacct)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(PAYACCT$4);
            target.setStringValue(payacct);
        }
    }
    
    /**
     * Removes the ith "PAYACCT" element
     */
    public void removePAYACCT(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PAYACCT$4, i);
        }
    }
    
    /**
     * Gets the "EXTDPAYEE" element
     */
    public net.ofx.types.x2003.x04.ExtendedPayee getEXTDPAYEE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.ExtendedPayee target = null;
            target = (net.ofx.types.x2003.x04.ExtendedPayee)get_store().find_element_user(EXTDPAYEE$6, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "EXTDPAYEE" element
     */
    public boolean isSetEXTDPAYEE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(EXTDPAYEE$6) != 0;
        }
    }
    
    /**
     * Sets the "EXTDPAYEE" element
     */
    public void setEXTDPAYEE(net.ofx.types.x2003.x04.ExtendedPayee extdpayee)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.ExtendedPayee target = null;
            target = (net.ofx.types.x2003.x04.ExtendedPayee)get_store().find_element_user(EXTDPAYEE$6, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.ExtendedPayee)get_store().add_element_user(EXTDPAYEE$6);
            }
            target.set(extdpayee);
        }
    }
    
    /**
     * Appends and returns a new empty "EXTDPAYEE" element
     */
    public net.ofx.types.x2003.x04.ExtendedPayee addNewEXTDPAYEE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.ExtendedPayee target = null;
            target = (net.ofx.types.x2003.x04.ExtendedPayee)get_store().add_element_user(EXTDPAYEE$6);
            return target;
        }
    }
    
    /**
     * Unsets the "EXTDPAYEE" element
     */
    public void unsetEXTDPAYEE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(EXTDPAYEE$6, 0);
        }
    }
}
